package com.acme.chat.ui;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class ChatSettingsDialog extends JDialog {
    private JTextField serverField;
    private JTextField portField;
    private JTextField nameField;

    /**
     * Create the dialog.
     */
    public ChatSettingsDialog() {
        setBounds(100, 100, 323, 183);
        getContentPane().setLayout(new BorderLayout());
        {
            JPanel okCancelPane = new JPanel();
            okCancelPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
            getContentPane().add(okCancelPane, BorderLayout.SOUTH);
            {
                JButton okButton = new JButton("OK");
                okButton.setActionCommand("OK");
                okCancelPane.add(okButton);
                getRootPane().setDefaultButton(okButton);
            }
            {
                JButton cancelButton = new JButton("Cancel");
                cancelButton.setActionCommand("Cancel");
                okCancelPane.add(cancelButton);
            }
        }
        {
            JPanel settingsPane = new JPanel();
            getContentPane().add(settingsPane, BorderLayout.CENTER);
            settingsPane.setLayout(new BoxLayout(settingsPane, BoxLayout.Y_AXIS));
            {
                JPanel serverSettingsPane = new JPanel();
                settingsPane.add(serverSettingsPane);
                serverSettingsPane.setLayout(null);
                {
                    JLabel serverLabel = new JLabel("Server:");
                    serverLabel.setBounds(5, 8, 60, 16);
                    serverSettingsPane.add(serverLabel);
                }
                {
                    serverField = new JTextField();
                    serverField.setBounds(66, 5, 226, 22);
                    serverSettingsPane.add(serverField);
                    serverField.setColumns(20);
                }
            }
            {
                JPanel portSettingsPane = new JPanel();
                settingsPane.add(portSettingsPane);
                portSettingsPane.setLayout(null);
                {
                    JLabel portLabel = new JLabel("Port:");
                    portLabel.setBounds(5, 8, 49, 16);
                    portSettingsPane.add(portLabel);
                }
                {
                    portField = new JTextField();
                    portField.setBounds(66, 5, 226, 22);
                    portSettingsPane.add(portField);
                    portField.setColumns(20);
                }
            }
            {
                JPanel nameSettingsPane = new JPanel();
                settingsPane.add(nameSettingsPane);
                nameSettingsPane.setLayout(null);
                {
                    JLabel nameLabel = new JLabel("Name:");
                    nameLabel.setBounds(5, 8, 56, 16);
                    nameSettingsPane.add(nameLabel);
                }
                {
                    nameField = new JTextField();
                    nameField.setBounds(66, 5, 226, 22);
                    nameSettingsPane.add(nameField);
                    nameField.setColumns(20);
                }
            }
        }
    }

}
